export function getMenuList(list, p_route) {
  const newMenu = [];
  list.forEach((i) => {
    const menu = {
      path: i.pid === 0 ? `/${i.route}` : i.route,
      name: i.route,
      component: i.pid === 0 ? "Layout" : `${p_route + "/" + i.route}`,
      meta: { title: i.name, icon: i.icon },
    };
    if (i.children && i.children.length > 0) {
      menu.children = getMenuList(i.children, i.route);
    }
    newMenu.push(menu);
  });
  return newMenu;
}
export function getPermissions(list) {
  const newPermissions = [];
  list.forEach((i) => {
    newPermissions.push(i.route);
  });
  return newPermissions
}